<template>
  <div class="main">
    <div class="BlueBanner">
    </div>
    <el-row class="card content">
      <el-col :span="12">
        <div class="">
            <img src="https://xxx.oss.com/dxdh/webp%20%281%29%20%281%29.png"  class="login_img"/>
        </div>
      </el-col>
      <el-col :span="12">
        <div class="biaodan">
          <div class="title1">
            卡片激活
          </div>
          <div class="one">
            <div class="tips">
              卡号
            </div>
            <input placeholder="请输入"  v-model="form.account" spellcheck ="false" class="input1"/>
          </div>
          <div class="one">
            <div class="tips">
              密码
            </div>
            <input placeholder="请输入" v-model="form.password" show-password class="input1"/>
          </div>
          
            <div style="margin-top:0.507292rem;text-align: left;">
                <el-button type="primary" class="submit btn1" @click="active()">立即激活</el-button>
            </div>
          
        </div>
      </el-col>
    </el-row>
  </div>
     
</template>
<script>
import sha from '../common/sha1';
export default {
  data(){
    return{
      form:{
        password:"",
        account:"",
      },
    }
  },
  methods:{
    active(){
      let password=sha.sha1(this.form.password)
      // console.log(password);
      this.$axios.post(`${this.baseURL}/sysAdmin/active?username=${this.form.account}&password=${password}`)
      .then(res=>{
        if(res.data.status==200){
          this.$notify({
            title:"登录成功",
            message:res.data.msg,
            type:"success"
          })
          sessionStorage.setItem('active_user',JSON.stringify(res.data.data))
        // this.resetSetItem('username',JSON.stringify(res.data.data.username))//main.js中重定义的setItem方法 用以在Home.vue中监听Storage变化
        //获取登录用户成绩信息
        // let username = JSON.parse(sessionStorage.username)
        // console.log(username);
        // this.$axios.post(`${this.baseURL}/scoreInfo/getScoreInfoByusername?username=${username}`)
        // .then(res=>{
        //   if(res.data.status==200){
        //     sessionStorage.setItem('form',JSON.stringify(res.data.data))
        //     // console.log(res.data);
        //     // console.log(this.baseURL);
        //   }
        // })
        // .catch(err=>{
        //   console.log(err);
        //   //若form为1则说明该用户还未填写成绩信息
        //   sessionStorage.setItem('form',1)
        // })
          this.$router.push('/people')
        }
        else{
          this.$notify({
            title:"登录失败",
            message:res.data.msg,
            type:"error"
          })
        }
      })
    },
    
  },
  mounted(){
    // this.setSelected();
  },
}
</script>
<style scoped>
.content{
    width: 1440px;
    min-height: 300px;
    background-color: #fff;
    margin: 100px auto;
    /* position: relative; */ 
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}
  .BlueBanner{
    /* clear:both; */
    background:url("https://xxx.oss.com/dxdh/1622366859254.png") ;
    /* background-color:#F7FF09; */
    /* background-size: 100%,100%; */
    width:100%;
    height:540px;
    background-repeat:no-repeat;
    margin: 0 auto;
    /* height: 128px; */
  }
  .card{
    height: 250px;
    background-color:#FFFFFF;
    width:1300px;
    position:relative;
	  /* left:300px; */
	  top:-500px;
    height: 768px;
    font-family: Noto Sans SC;
    font-weight: 400;
  }
  .login_img{
    margin-top: 60px;
    width: 450px;
    height: 650px;
  }
  .input1{
    background-color:rgba(0, 0, 0, 0.08);
    width: 380px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid white; 
    font-family: Noto Sans SC;
    font-weight: 400;
    font-size: 20px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 14px;
  }
  .input1:focus{
    outline: none;
  }
  .Tips{
    /* width: 130px; */
    /* color: teal; */
    margin-bottom: 30px;
  }
  .one{
    font-family: Noto Sans SC;
    font-weight: 400;
    font-size:20px;
    width: 600px;
    text-align: left;
    margin-left: 100px;
    margin-top: 40px;
  }
  .biaodan{
    font-size:20px;
    font-weight: bold;
    margin-top: 120px;
    /* background-color:teal; */
  }
  .btn1{
    font-size:24px;
    text-align: center;
    margin-left: 100px;
    width: 380px;
    height: 62px;
    font-family: Noto Sans SC;
    font-weight: 300;
    border-radius: 10px;
  }
  .title1{
    text-align: center;
    margin-right: 55px;
    font-size: 42px;
    font-family: Noto Sans SC;
    font-weight: 500;
    line-height: 71px;
  }
  .main{
    min-height: 300px;
}
</style>